package com.dd.cloud.user.req.drugs;

import com.dd.cloud.common.annotate.validation.Desc;
import com.dd.cloud.common.annotate.validation.FixedValue;
import com.dd.cloud.common.annotate.validation.Name;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;

/**
 * <p>
 * 添加药品入库记录
 * </p>
 *
 * @author czg
 * @since 2022-05-09
 */
@Data
public class AddDrugsWarehousingReq implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 药材名称
     */
    @Name(begin = "药材名称")
    private String herbName;

    /**
     * 药材编码
     */
    @Name(begin = "药品编码", required = false)
    private String drugnum;

    /**
     * 用法及注意事项
     */
    @Name(begin = "单据号")
    private String receiptNo;

    /**
     * 药材单位
     */
    @FixedValue(strValues = {"g","条","具","枚","片", "个","对","毫升","只","粒"})
    private String useUnit;

    /**
     * 药材单价
     */
    private BigDecimal price;

    /**
     * 药材原价
     */
    private BigDecimal originalPrice;


    /**
     * 入库数量
     */
    @NotNull(message = "入口数量不能为空")
    @Min(0)
    private BigDecimal wareQty;

    /**
     * 规格
     */
    @Desc(begin = "规格", required = false)
    private String specification;

    /**
     * 备注
     */
    @Length(max = 500)
    private String remarks;

    /**
     * 产地
     */
    @Name(begin = "产地", required = false)
    private String origin;

    /**
     * 供应商
     */
    @Name(begin = "供应商", required = false)
    private String supplier;

    /**
     * 有效日期
     */
    private LocalDate termDate;

    /**
     * 药材折扣价
     */
    private BigDecimal publicPrice;

}
